#!/bin/sh

cd <%= node['gitlab']['gitlab-rails']['dir'] %>/working

exec 2>&1

exec chpst -e /opt/gitlab/etc/gitlab-rails/env -P \
  -U <%= @options[:user] %>:<%= @options[:groupname] %> \
  -u <%= @options[:user] %>:<%= @options[:groupname] %> \
  /opt/gitlab/embedded/bin/bundle exec mail_room \
    -c <%= @options[:mail_room_config] %> \
    --log-exit-as <%= @options[:exit_log_format] %>
